﻿// <copyright file="VolumeContainer.cs" company="Sinclair Community College">
// Copyright 2010 Sinclair Community College
// </copyright>
// <originalAuthor>Patrick S. Seymour (patrick.seymour@gmail.com)</originalAuthor>

namespace SinclairCC.AppV
{
    using System;

    /// <summary>
    /// This container contains information necessary to initialize the volume.
    /// </summary>
    /// <remarks>
    /// The primary volume container points to the volume information data structure which
    /// contains basic information about the volume. The secondary volume container points
    /// to the duplicate volume information data structure which is used as a backup copy
    /// of the Volume Container Primary. The secondary volume container is unused.
    /// </remarks>
    public class VolumeContainer : Container
    {
        private CSRInfo csrInfo;
        private CSRData csrData;

        /// <summary>
        /// Initializes a new instance of the VolumeContainer class.
        /// </summary>
        /// <param name="fileReader">
        /// Contains the raw container data from the volume file.
        /// </param>
        public VolumeContainer(System.IO.BinaryReader fileReader)
            : base(fileReader)
        {
            this.ReadContainer(fileReader);
        }
        
        /// <summary>
        /// Reads the actual data for this container from the file.
        /// </summary>
        protected void ReadContainer(System.IO.BinaryReader fileReader)
        {
            this.csrInfo = new CSRInfo(fileReader);
            this.csrData = new CSRData(fileReader);
        }

        public CSRInfo DataInformationRegion
        {
            get { return this.csrInfo; }
        }

        public CSRData DataStorageRegion
        {
            get { return this.csrData; }
        }
    }
}
